<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" 
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:head>
	<meta http-equiv="cache-control" content="no-cahce" />
	<title>Login</title>
	<style type="text/css">
.loginArea {
	float: left;
	/*width: 50%;*/
	/*background: navy;*/
	margin-top: 10%;
	margin-left: 40%;
}

</style>
</h:head>
<h:body>
	<h:form id="loginForm">
		<rich:popupPanel id="messagePopup" modal="true" resizeable="true" show="#{!empty facesContext.maximumSeverity}" onmaskclick="#{rich:component('messagePopup')}.hide()">
			<f:facet name="header">
				<h:outputText value="Message" />
			</f:facet>
			<f:facet name="controls">
				<h:outputLink value="#" onclick="#{rich:component('messagePopup')}.hide(); return false;">
                X
            </h:outputLink>
			</f:facet>
			<p><rich:messages/></p>
		</rich:popupPanel>
		<div class="loginArea">
			<rich:panel header="Login" style="width:250px" rendered="#{loginBean.loginpass == false}">
				<h:panelGrid columns="2">
					<h:outputLabel value="User ID:" />
					<h:inputText id="userid" value="#{loginBean.userid}" />
					<h:outputLabel value="Password:" />
					<h:inputSecret id="pwd" value="#{loginBean.pwd}" />
					<h:outputText value="&#160;" />
					<h:commandButton value="Login" actionListener="#{loginBean.doLogin}" />
				</h:panelGrid>
			</rich:panel>
			<rich:panel header="Welcome #{loginBean.userid}" style="width:250px" rendered="#{loginBean.loginpass == true}">
				<h:commandButton value="Logout" actionListener="#{loginBean.doLogout}" style="margin-left:40%" />
			</rich:panel>
		</div>
	</h:form>
</h:body>
</html>